﻿angular.module('resources.commonProxy', []);
angular.module('resources.commonProxy').factory('commonProxy', ['rresource', '$http', 'APPSETTING', function (rresource, $http, APPSETTING) {
    var factory = rresource('common');

    factory.search = function (successcb, failedcb) {
        return factory.query('', successcb, failedcb);
    };

    //update status
    factory.updateStatus = function (id, status, statusFlg,mailId, successcb, failedcb) {
        $http({
            url: APPSETTING['serverUrl'] + '/api/common?id=' + id + '&status=' + status + '&statusFlg=' + statusFlg + '&mailId=' + mailId,
            method: 'POST',
        }).success(function (response) {
            successcb(response);
        }).error(function (ex) {
            failedcb(ex);
        });
    };

    return factory;
} ]);
